from functools import reduce
from itertools import product

numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
transformed=list(map(lambda x:x**2 if x%2==0 else x,numbers))
filtered=list(filter(lambda x:x>20,transformed))
product=reduce(lambda x,y:x*y,filtered,1)

def prime_generator(n):
    if n<2:
        return
    yield 2
    for num in range(3,n+1,2):
        is_prime=True
        for i in range(3,int(num**0.5)+1,2):
            if num%i==0:
                is_prime=False
                break
        if is_prime:
            yield num
print(transformed)
print(filtered)
print(product)
print(list(prime_generator(20)))

